#pragma once

#include "ColorBlendAttachment.h"
#include "RHIPipeline.h"

class ComputePipeline : public RHIPipeline
{
	struct BuilderDetails {

		RefCountPtr<RHIDescriptor> descriptor;

		RefCountPtr<RHIPipeline> basePipelineHandle;
		int32 basePipelineIndex;

		BuilderDetails()
		{
			// 父管线
			basePipelineIndex = -1;
		}
	};

public:

	class Builder : public BuilderBase<BuilderDetails> {
		friend struct BuilderDetails;
	public:
		Builder() noexcept;
		Builder(Builder const& rhs) noexcept;
		Builder(Builder&& rhs) noexcept;
		~Builder() noexcept;
		Builder& operator=(Builder const& rhs) noexcept;
		Builder& operator=(Builder&& rhs) noexcept;

		/************************************************************************/
		/*                              Descriptor                              */
		/************************************************************************/

		Builder& SetDescriptor(RefCountPtr<RHIDescriptor> descriptor) noexcept;

		/************************************************************************/
		/*                           BasePipeline                               */
		/************************************************************************/

		Builder& SetBasePipeline(RefCountPtr<RHIPipeline> basePipeline, int32 index = -1) noexcept;

		RefCountPtr<ComputePipeline> Build();
		RefCountPtr<ComputePipeline> Build(RenderProcess* process, const std::string& name);

	private:

		friend class ComputePipeline;
	};

	ComputePipeline(BuilderDetails& builderDetails);

	virtual void ReleaseResource() override;

protected:

};